// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
const db_lxj = cloud.database()
// 云函数入口函数
exports.main = async (event, context) => {
  if(event.canteen == '五谷渔粉'){
    return await db_lxj.collection('food')
    .where({
      restaurant:"五谷渔粉"
    })
    .get()
  }else if(event.canteen == '闽大汉堡'){
    return await db_lxj.collection('food')
    .where({
      restaurant:"闽大汉堡"
    })
    .get()
  }else if(event.canteen == '古茗'){
    return await db_lxj.collection('food')
    .where({
      restaurant:"古茗"
    })
    .get()
  }
 
}